<!DOCTYPE html>
<html lang="zh-cn" xml:lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"/>
    <meta name="renderer" content="webkit"/>
    <meta name="google" content="notranslate" />
    <meta name="msapplication-tap-highlight" content="no">
    <meta http-equiv="x-dns-prefetch-control" content="on">
    <link rel="dns-prefetch" href="//storagecdn.xuetangx.com">
    <link rel="dns-prefetch" href="//storage.xuetangx.com">
    <link rel="dns-prefetch" href="//cdn.mathjax.org">
    <link rel="shortcut icon" href="" type="image/x-icon">
    <link rel="icon" href="" type="image/x-icon">

    <!--
    search.xml:
    <?xml version="1.0" encoding="utf-8"?>
    <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
    　<InputEncoding>UTF-8</InputEncoding>
    　<ShortName>关键词搜索</ShortName>
    　<Description>关键词搜索</Description>
    　<Image height="16" width="16" type="image/vnd.microsoft.icon">images/favicon.ico</Image>
    　<Url type="text/html" template="search.PHP?keyword={searchTerms}" />
    </OpenSearchDescription>
    <link rel="search" title="xuetangx.com" href="search.xml?v1.0" type="application/opensearchdescription+xml">-->
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-transform ">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta http-equiv="Expires" content="0">
    <meta name="keywords" content="学堂在线,学堂云,学分课,学分链">
    <meta name="description" content="学堂在线,学堂云,学分课,学分链">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>demo</title>
    <meta content="" name="keywords">

</head>
<body style="padding:0;margin:0;">
<div id="qa-video-wrap" style="position:relative;width:100%;height:400px;background:#000;overflow: hidden;"></div>
<input id="test" />
<input id="test2" style="width:50%;" />

<script type="text/javascript" src="//storage.xuetangx.com/public_assets/xuetangx/js/jquery.min.js"></script>

<script type="text/javascript" src="XtPlayer.min.js"></script>
<script>
//var quality20 = "http://ali.cdn.xuetangx.com/76ab9d428480558e-20.mp4";
//var quality20 = "http://vdn-flv.xuetangx.com/xuetanglive/zhibo0003.flv";
//var quality20 = "https://youku.com-l-youku.com/20190207/20335_d1f19bfb/index.m3u8";
//var quality20 = "./mp4tom3u8/input.m3u8";
//var quality20 = "http://vdn-snap.xuetangx.com/hls/pkuai0516.m3u8?starttime=1558005600&endtime=1558012800";
//var quality10 = "https://youku.com-l-youku.com/20190207/20335_d1f19bfb/index.m3u8";
var videoElement = $('<video preload="true" webkit-playsinline="true" x-webkit-airplay="true" x5-playsinline="true" playsinline="true" x5-video-player-type="h5" x5-video-player-fullscreen="true"><p>您的浏览器不支持HTML5播放器！</p></video>');
var player = new XtPlayer($('#qa-video-wrap'), {
   id: "xxx",//旧主站、新学堂云2.0、3.0、军职青海网络干部学院web端及浙江网络干部学院web端视频id
   sku_id: 'xxx',//sku是班级+服务等级
   classroom_id: 'xxxx',//班级id
   cid: "xxx",//课程id
   cc: "yyyy", //金山上传id,ccid
   userId: "3445",//心跳打点用user_id
   isDrag: true,//是否可以拖拽进度条
   isAbleOcclusion: true, //是否可以遮挡，默认false不可以遮挡
   lob: "plat",  //plat 主站/cloud2 学堂云2.0/cloud3 学堂云3.0/cloud4 学堂云4.0/plat2 新主站/zyk_web 资源库端 
   isHeart: true,
   heartSrc: '/heartbeat',
   autoplay: false,
   poster: "./前端课程图片.jpg",
   server: 'live',//live-直播、vod-点播、playback-直播回放
   serverType: 'video', //音视频类型：video-视频，audio-音频
   hiddenQuestion: true,
   hiddenKnowledgePoint: true,
   duration: 0, //接口提供-视频播放时长
   volume: {
       value: 0.8
   },
   speed: {
       show: true,
       value: 1.0,
       speedValue: [2.0, 1.5, 1.0, 0.5],
   },
   isShowControls: true,
   isShowProgress: true,
   urls: {//视频地址列表: vodUrls、liveUrls、cdnUrls
		vodUrls: {//https://youku.com-l-youku.com/20190207/20335_d1f19bfb/index.m3u8
			url_default: 'url_480P',
			url_270P: "../fbfb853ca7304ffaac1d924c872ebafd/fbfb853ca7304ffaac1d924c872ebafd.m3u8",
			url_480P: "../9ae8bc0f51ace5d1d3d51f71d0e1c218/9ae8bc0f51ace5d1d3d51f71d0e1c218.m3u8",
			url_720P: "https://youku.com-l-youku.com/20190207/20335_d1f19bfb/index.m3u8",
			url_1080P: "http://vdn-snap.xuetangx.com/hls/pkuai0516.m3u8?starttime=1558005600&endtime=1558012800",
			url_audio: "http://vdn-snap.xuetangx.com/hls/pkuai0516.m3u8?starttime=1558005600&endtime=1558012800"
		},
		liveUrls:{
			url_default: 'url_480P',
			url_270P: "../fbfb853ca7304ffaac1d924c872ebafd/fbfb853ca7304ffaac1d924c872ebafd.m3u8",
			url_480P: "https://youku.com-l-youku.com/20190207/20335_d1f19bfb/index.m3u8",
			url_720P: "",
			url_1080P: "",
			url_audio: "http://vdn-snap.xuetangx.com/hls/pkuai0516.m3u8?starttime=1558005600&endtime=1558012800"
		},
		CDNUrls: [//点播切换cdn
			{
				url_default: 'url_480P',
				url_270P: "http://ali.cdn.xuetangx.com/76ab9d428480558e-20.mp4",
				url_480P: "http://vdn-snap.xuetangx.com/hls/pkuai0516.m3u8?starttime=1558005600&endtime=1558012800",
				url_720P: "",
				url_1080P: "",
				url_audio: ""
	    	 },
	    	 {
	    		 url_default: 'url_480P',
	    		 url_270P: "http://ali.cdn.xuetangx.com/76ab9d428480558e-20.mp4",
				 url_480P: "http://vdn-snap.xuetangx.com/hls/pkuai0516.m3u8?starttime=1558005600&endtime=1558012800",
				 url_720P: "",
				 url_1080P: "",
				 url_audio: ""
	    	 },
	    	 {
	    		 url_default: 'url_480P',
	    		 url_270P: "http://ali.cdn.xuetangx.com/76ab9d428480558e-20.mp4",
				 url_480P: "http://vdn-snap.xuetangx.com/hls/pkuai0516.m3u8?starttime=1558005600&endtime=1558012800",
				 url_720P: "",
				 url_1080P: "",
				 url_audio: ""
	    	 }
		]
	},
   caption: {
       show: true,
       src: [{
           name: '简体中文',
           src: 'en-caption.json',
           availableSrc: '',
           default: true
       }, {
    	   name: 'English',
           availableSrc: '',
           src: 'zh-caption.json'
       }]
   },
   startTime: 70,//点播、直播：填充开发播放时间，其中直播为了统计打点
   endTime: null,
   debug: false
});
player.on("ended", function(e,data){
	console.log(e);
	//连续播放下一个
});

player.on('heartback', function(e){
	console.log("打点回调",e);
});
window.onresize = function(){
	　　var width = window.screen.width;
	　　var height = window.screen.height;
	　　if(width>height){
	　　　　width = [height,height = width[0]];
	　　　　$("video")[0].style.width = width + "px";
	  　　　　	$("video")[0].style.height = height + "px";
	　　}
	}
</script>
</body>
</html>